package cn.laixueit.controller;

import cn.laixueit.pojo.Student;
import cn.laixueit.pojo.Vo;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/student")
public class StudentController {

    @RequestMapping(value = "/save",method = RequestMethod.POST)
    public String save(Student student){
        System.out.println(student);
        return "ok";
    }

    @RequestMapping(value = "/del")
    public String del(int[] arr){
        System.out.println(Arrays.toString(arr));
        return "ok";
    }

    /*@RequestMapping(value = "/saveAll")
    public String saveAll(List<Student> students){
        System.out.println(students);
        return "ok";
    }

    @RequestMapping(value = "/saveAll2")
    public String saveAll2(Map<String,String> map){
        System.out.println(map);
        return "ok";
    }*/

    @RequestMapping(value = "/saveAll3")
    public String saveAll3(Vo vo){
        System.out.println(vo);
        return "ok";
    }

}
